package com.sys.SysAlerts.service.impl;

import java.util.List;
import com.sys.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sys.SysAlerts.mapper.SysAlertsMapper;
import com.sys.SysAlerts.domain.SysAlerts;
import com.sys.SysAlerts.service.ISysAlertsService;

/**
 * 告警记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-03
 */
@Service
public class SysAlertsServiceImpl implements ISysAlertsService 
{
    @Autowired
    private SysAlertsMapper sysAlertsMapper;

    /**
     * 查询告警记录
     * 
     * @param id 告警记录主键
     * @return 告警记录
     */
    @Override
    public SysAlerts selectSysAlertsById(Integer id)
    {
        return sysAlertsMapper.selectSysAlertsById(id);
    }

    /**
     * 查询告警记录列表
     * 
     * @param sysAlerts 告警记录
     * @return 告警记录
     */
    @Override
    public List<SysAlerts> selectSysAlertsList(SysAlerts sysAlerts)
    {
        return sysAlertsMapper.selectSysAlertsList(sysAlerts);
    }

    /**
     * 新增告警记录
     * 
     * @param sysAlerts 告警记录
     * @return 结果
     */
    @Override
    public int insertSysAlerts(SysAlerts sysAlerts)
    {
        sysAlerts.setCreateTime(DateUtils.getNowDate());
        return sysAlertsMapper.insertSysAlerts(sysAlerts);
    }

    /**
     * 修改告警记录
     * 
     * @param sysAlerts 告警记录
     * @return 结果
     */
    @Override
    public int updateSysAlerts(SysAlerts sysAlerts)
    {
        sysAlerts.setUpdateTime(DateUtils.getNowDate());
        return sysAlertsMapper.updateSysAlerts(sysAlerts);
    }

    /**
     * 批量删除告警记录
     * 
     * @param ids 需要删除的告警记录主键
     * @return 结果
     */
    @Override
    public int deleteSysAlertsByIds(Integer[] ids)
    {
        return sysAlertsMapper.deleteSysAlertsByIds(ids);
    }

    /**
     * 删除告警记录信息
     * 
     * @param id 告警记录主键
     * @return 结果
     */
    @Override
    public int deleteSysAlertsById(Integer id)
    {
        return sysAlertsMapper.deleteSysAlertsById(id);
    }
}
